<template>
 <div>
<van-nav-bar
  title="京东登录"
  left-text="返回"
  right-text="退出"
  left-arrow

  @click-left="$router.go(-1)"
  @click-right="onClickRight"
/>
<p>个人中心</p>
<h1 @click="qudizhi">地址</h1>
<h2 @click="qudingdan">订单</h2>
<!-- <van-cell is-link title="基础用法" @click="show = true" />
<van-cell is-link title="基础用法" @click="show = true" /> -->
 </div>
</template>

<script setup lang='ts'>
import { ref } from 'vue';
import { useUserStore } from '@/store/userstore'
    // 为了从 store 中提取属性时保持其响应性，你需要使用 storeToRefs()
    import { storeToRefs } from 'pinia'
    import { useRouter } from 'vue-router';
    const router =useRouter()
     // 创建userStore 对象
    const userStore = storeToRefs(useUserStore());
    // 取出该对象模块中的userId 属性,这个pinia 中存储的数据
    const { userId } = userStore;
   function onClickRight() {
      localStorage.removeItem('pinia-user')
      localStorage.removeItem('token')
      router.push('/home')
   }
   const qudizhi = ()=>{
    router.push('/dizhi')
   }
   const qudingdan = ()=>{
    router.push('/dingdan')
   }
  
</script>
<style scoped>

</style>